package com.llp.SpeedKey;

import java.util.Random;
import java.util.Scanner;

public class shuzu {
    public static void main(String[] args) {
        int[] codes = new int[5];//数组长度为5
        Scanner code = new Scanner(System.in);//扫描器
        //i = 0 1 2 3 4
        for (int i = 0;i < codes.length;i++){
            System.out.println("请输入第" + (i + 1) + "位员工工号：");
            int a = code.nextInt();
            codes[i] = a;
        }
        Random b = new Random();
        for (int i = 0;i < codes.length;i++){
            int index = b.nextInt(codes.length);//随机数范围0~4,左闭右开
            int temp = codes[index];
            codes[index] = codes[i];
            codes[i] = temp;

        }
        System.out.println("随机顺序为：");
        for (int i = 0;i < codes.length;i++){
            System.out.println(codes[i] + ",");
        }
    }
}
